package com.edu.service.impl;

import java.util.List;

import com.edu.bean.Book;
import com.edu.dao.BookDao;
import com.edu.dao.impl.BookDaoImpl;
import com.edu.service.BookService;

public class BookServiceImpl implements BookService {

	private BookDao bookDao = new BookDaoImpl();
	@Override
	public List<Book> getAllBook() {
		return bookDao.selectAll();
	}
	@Override
	public int deleteBookById(int bookId) {
		return bookDao.deleteBookById(bookId);
	}
	@Override
	public int addBook(Book book) {
		return bookDao.insertBook(book);
	}
	@Override
	public Book getBookById(int bookId) {
		return bookDao.selectBookById(bookId);
	}
	@Override
	public int updateBook(Book book) {
		return bookDao.updateBook(book);
	}
	@Override
	public List<Book> getBookByName(String bookName) {
		return bookDao.selectBookByBookName(bookName);
	}

}
